const { sequelize } = require('../../core/db')

const { Sequelize, Model } = require('sequelize')

// 公司信息表
class CompanyInfo extends Model {}

CompanyInfo.init({
  id: {
    type: Sequelize.INTEGER,
    autoIncrement: true,
    primaryKey: true
  },
  companyName: Sequelize.STRING(50),
  tel: Sequelize.STRING(50),
  address: Sequelize.STRING(50),
  contact: Sequelize.STRING(50),
  mobile: Sequelize.STRING(50),
  zipCode: Sequelize.STRING(50),
  email: Sequelize.STRING(100),
  QQ: Sequelize.STRING(50),
  QRCode: Sequelize.STRING(100),
  desc: Sequelize.STRING(2000),
  content: Sequelize.STRING(5000),
  copyRight: Sequelize.STRING(500),
  beiAnCode: Sequelize.STRING(30)
}, { sequelize })

// Note: using `force: true` will drop the table if it already exists
CompanyInfo.sync().then(() => {
  return CompanyInfo.create({
    companyName: '博言传动机械有限公司',
    tel: '13824304970',
    address: '江苏省无锡市惠山区钱桥镇藕塘工区路3号',
    contact: '江**',
    mobile: '123456456',
    QRCode: '/images/wechat_img.png',
    email: '410958040@qq.com',
    copyRight: 'MIT Licensed | Copyright © 2019-present 江学美',
    beiAnCode: '',
    content: '&lt;a class="cimg" title="无锡博言传动机械有限公司" href="http://www.rain-lock.com/" target="_blank"&gt;&lt;img src="http://localhost:8888/images/company.jpg" /&gt;&lt;/a&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href="http://www.rain-lock.com/" target="_blank" class="cname" title="无锡博言传动机械有限公司"&gt;无锡博言传动机械有限公司&lt;/a&gt;（Wuxi Boyan Hardware & Tools Co.,Ltd.）是于2011 年在苏州工业园区正式注册成立，是一家专门为您提供国外专业及高品质工具和化学品的公司。\n为您提供知名品牌工业产品5 万多种，并专职服务于企业的MRO 采购。无锡博言传动机械有限公司是国家外经贸局，海关总署批注的有进出口权的公司，我们的业务覆盖汽车、电力、石化、钢铁、轨道交通、船舶、机械、公用事业等多个领域，有着丰富的行业经验。我们为客户提供高质量的产品和专业及时的服务，拥有完善的销售、物流、技术支持体系。'
  });
})

module.exports = CompanyInfo